//
//  Patient.m
//  Aun
//
//  Created by Alexander on 8/25/10.
//  Copyright 2010 KTH Royal Institute of Technology. All rights reserved.
//

#import "Patient.h"


@implementation Patient

@synthesize photo;
@synthesize bubbleText;
@synthesize patientSummary;
@synthesize questionsForConsensusMeeting;
@synthesize previousDecisions;
@synthesize finishedAndOngoingTreatments;
@synthesize activities;

- (id)    initWithIdentifier:(NSString *)anIdentifier 
						name:(NSString *)aName
					username:(NSString *)aUsername
					passhash:(NSString *)aPasshash
					   photo:(UIImage *)aPhoto
				  bubbleText:(NSString *)aBubbleText
			  patientSummary:(NSString *)aPatientSummary
questionsForConsensusMeeting:(NSString *)nQuestionsForConsensusMeeting
		   previousDecisions:(NSString *)nPreviousDecisions
finishedAndOngoingTreatments:(NSString *)nFinishedAndOngoingTreatments 
				  activities:(NSMutableArray *)nActivities {
    self = [super initWithIdentifier:anIdentifier name:aName username:aUsername passhash:aPasshash];
    if (self) {
		[photo = aPhoto retain];
		[bubbleText = aBubbleText retain];
		[patientSummary = aPatientSummary retain];
		[questionsForConsensusMeeting = nQuestionsForConsensusMeeting retain];
		[previousDecisions = nPreviousDecisions retain];
		[finishedAndOngoingTreatments = nFinishedAndOngoingTreatments retain];
		[activities = nActivities retain];
    }
    return self;
}

// just creates an empty NSMutableArray for activities
- (id)    initWithIdentifier:(NSString *)anIdentifier 
						name:(NSString *)aName
					username:(NSString *)aUsername
					passhash:(NSString *)aPasshash
					   photo:(UIImage *)aPhoto
				  bubbleText:(NSString *)aBubbleText
			  patientSummary:(NSString *)aPatientSummary
questionsForConsensusMeeting:(NSString *)nQuestionsForConsensusMeeting
		   previousDecisions:(NSString *)nPreviousDecisions
finishedAndOngoingTreatments:(NSString *)nFinishedAndOngoingTreatments {
	NSMutableArray *array = [[NSMutableArray alloc] init];
    self = [self initWithIdentifier:(NSString *)anIdentifier 
							   name:(NSString *)aName
						   username:(NSString *)aUsername
						   passhash:(NSString *)aPasshash
							  photo:(UIImage *)aPhoto
						 bubbleText:(NSString *)aBubbleText
					 patientSummary:(NSString *)aPatientSummary
	   questionsForConsensusMeeting:(NSString *)nQuestionsForConsensusMeeting
				  previousDecisions:(NSString *)nPreviousDecisions
	   finishedAndOngoingTreatments:(NSString *)nFinishedAndOngoingTreatments
						 activities:array];
	[array release];
    return self;
}

- (void)dealloc {
	[photo release];
	[bubbleText release];
	[patientSummary release];
	[questionsForConsensusMeeting release];
	[previousDecisions release];
	[finishedAndOngoingTreatments release];
	[activities release];
	[super dealloc];
}

@end
